<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <input type="text">
    <button>添加</button>
    <ul class="fruit-list">
        <li>香蕉</li>
        <li>苹果</li>
        <li>鸭梨</li>
    </ul>
    <script src="JavaScript/jquery.min.js"></script>
    <script>
        $("button").click(function() {
            let value = $("input").val();
            let li = $(`<li>${value}</li>`);
            $(".fruit-list").append(li);
        })
        $(".fruit-list").on("click", "li", function() {
            $(this).remove();
        })
    </script>
</body>

</html>